package ru.susu.algebra.wrapper.number;

import java.math.BigInteger;

/**
 * @author akargapolov
 * @since: 24.03.2009
 */
public class LongWrapper implements INumberWrapper<Long>
{
	private long _value;

	public LongWrapper(Long value)
	{
		_value = value;
	}

	@Override
	public INumberWrapper<Long> add(INumberWrapper<Long> other)
	{
		return new LongWrapper(_value + other.getValue());
	}

	@Override
	public INumberWrapper<Long> divide(INumberWrapper<Long> other)
	{
		return new LongWrapper(_value / other.getValue());
	}

	@Override
	public Long getValue()
	{
		return _value;
	}

	@Override
	public INumberWrapper<Long> multiply(INumberWrapper<Long> other)
	{
		return new LongWrapper(_value * other.getValue());
	}

	@Override
	public INumberWrapper<Long> subtract(INumberWrapper<Long> other)
	{
		return new LongWrapper(_value - other.getValue());
	}

	@Override
	public void setValue(Number value)
	{
		_value = value.longValue();
	}

	@Override
	public long remainder(long val)
	{
		return _value % val;
	}

	@Override
	public INumberWrapper<Long> mod(BigInteger mod) throws Exception
	{
		throw new RuntimeException();
	}

}
